package com.fjzx.androidframe.ui.progress;

import android.app.Dialog;
import android.content.Context;

import com.fjzx.androidframe.ui.R;

/**
 * 文件下载对话框
 * @author xiongyongcong
 *
 */
public class DownloadProgressDialog extends Dialog {
	/** 进度条 **/
	private NumberProgressBar progressBar;

	public DownloadProgressDialog(Context context) {
		this(context, R.style.UpgradeDialog);
	}

	public DownloadProgressDialog(Context context, int theme) {
		super(context, theme);
		setCancelable(false);
		setCanceledOnTouchOutside(false);
		initView();
	}

	private void initView() {
		setContentView(R.layout.dialog_download_progress);
		progressBar = findViewById(R.id.progressbar);
	}
	
	/**
	 * 更新进度
	 * @param progress 百分制进度
	 */
	public void updateProgress(int progress) {
		progressBar.setProgress(progress);
	}
}
